package clients

import (
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/tools/clientcmd"
	"log"
)

func InitK8sConfig() *kubernetes.Clientset {
	config, err := clientcmd.BuildConfigFromFlags("", "client/kubeconfig")
	if err != nil {
		log.Fatal(err)
	}
	config.Insecure = true
	clientset, err := kubernetes.NewForConfig(config)
	if err != nil {
		log.Fatal(err)
	}
	return clientset
}
